package com.ss.ttm.player;

import android.content.Context;
import android.os.RemoteException;
import android.view.Surface;

import inline.ScreenshotListener;

public class r extends f implements Notifier {
    private long a;
    private TTPlayer mTTPlayer;
    private static String c;
    private TTPlayerClient d;
    private Context e;

    static {
        r.class.getSimpleName();
    }

    private r(Context context) {
        this.a = System.currentTimeMillis();
        this.e = context;
    }

    public static final r a(TTPlayerClient ttPlayerClient, Context context) {
        r v0_1;
        Class v1 = r.class;
        synchronized (v1) {
            if (r.c == null) {
                r.c = m.d(context);
                if (TTPlayer.getAppPath() == null) {
                    TTPlayer.setTempFileDir(r.c);
                }
            }
            v0_1 = new r(context);
            v0_1.d = ttPlayerClient;
            try {
                v0_1.mTTPlayer = new TTPlayer(context, v0_1.a);
                v0_1.mTTPlayer.setNotifyer(((Notifier) v0_1));
            } catch (Exception v0_2) {
                v0_2.printStackTrace();
                v0_1 = null;
            }
        }
        return v0_1;
    }

    public final int getIntOption(int arg2, int arg3) {
        return this.mTTPlayer.getIntOption(arg2, arg3);
    }

    public final int setLongOption(int arg3, long arg4) {
        return this.mTTPlayer.setLongOption(arg3, arg4);
    }

    public final int setStringOption(int arg2, String arg3) {
        return this.mTTPlayer.setStringOption(arg2, arg3);
    }

    public final void prevClose() {
        this.mTTPlayer.prevClose();
    }

    public final void setVolume(float arg2, float arg3) {
        this.mTTPlayer.setVolume(arg2, arg3);
    }

    public final void setLooping(int arg2) {
        this.mTTPlayer.setLooping(arg2);
    }

    public final void mouseEvent(int arg2, int arg3, int arg4) {
        this.mTTPlayer.mouseEvent(arg2, arg3, arg4);
    }

    public final void setNotifyerState(long arg2) {
        this.mTTPlayer.setNotifyerState(arg2);
    }

    public final void onPlayerNotify(long arg2, int arg4, int arg5, int arg6, String arg7) {
        this.d.onPlayerNotify(arg4, arg5, arg6, arg7);
    }

    public final void onPlayLogInfo(long arg2, int arg4, int arg5, String arg6) {
        this.d.onPlayLogInfo(arg4, arg5, arg6);
    }

    protected final void setOnScreenshotListener(ScreenshotListener arg2) {
        this.mTTPlayer.setOnScreenshotListener(arg2);
    }

    public final void setVideoSurface(Surface arg2) {
        this.mTTPlayer.setVideoSurface(arg2);
    }

    public final void setDataSource(String arg2) {
        this.mTTPlayer.setDataSource(arg2);
    }

    public final void setCacheFile(String arg2, int arg3) {
        this.mTTPlayer.setCacheFile(arg2, arg3);
    }

    public final int setIntOption(int arg3, int arg4) {
        int v0 = 65535;
        try {
            v0 = this.mTTPlayer.setIntOption(arg3, arg4);
        } catch (RemoteException v1) {
            v1.printStackTrace();
        }

        return v0;
    }

    public final long getLongOption(int arg3, long arg4) {
        return this.mTTPlayer.getLongOption(arg3, arg4);
    }

    public final void close() {
        this.mTTPlayer.close();
    }

    public final void rotateCamera(float arg2, float arg3) {
        this.mTTPlayer.rotateCamera(arg2, arg3);
    }

    public final void seekTo(int arg2) {
        this.mTTPlayer.seekTo(arg2);
    }

    public final String getStringOption(int arg2) {
        return this.mTTPlayer.getStringOption(arg2);
    }

    public final void release() {
        TTPlayer v0 = this.mTTPlayer;
        this.mTTPlayer = null;
        v0.release();
    }

    public final void start() {
        this.mTTPlayer.start();
    }

    public final void pause() {
        this.mTTPlayer.pause();
    }

    public final void reset() {
        this.mTTPlayer.reset();
    }

    public final void stop() {
        this.mTTPlayer.stop();
    }

    public final void prepare() {
        this.mTTPlayer.prepare();
    }

    public final Context i() {
        return this.e;
    }

    public final int j() {
        return 1;
    }

    protected final boolean k() {
        return this.mTTPlayer != null;
    }

    protected final int l() {
        return this.mTTPlayer.getIntOption(35, -1);
    }

    public final void takeScreenshot() {
        this.mTTPlayer.takeScreenshot();
    }
}

